<% layout('/layouts/default.html', {title: '检车人信息管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(tblZdJcr.isNewRecord ? '新增检车人信息' : '编辑检车人信息')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${tblZdJcr}" action="${ctx}/tbl/checkman/tblZdJcr/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="recId"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('列检车间')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="areaCode" dictType="LJCJZD" blankOption="true" class="form-control required" onchange="areaChange()"/>
								<#form:input path="area" class="form-control hide"/>
							</div>
						</div>
					</div>
					
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('场所')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="placeCode" dictType="LJSZD" blankOption="true" class="form-control required" onchange="placeChange()"/>
								<#form:input path="place" class="form-control hide"/>
							</div>
						</div>
					</div>
					
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('检车人')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<!-- <#form:select path="jcrCode" dictType="" blankOption="true" class="form-control" /> -->
								<#form:input path="jcrName" maxlength="10" class="form-control required"/>
							</div>
						</div>
					</div>
					
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('组别')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="team" dictType="team" blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});

//场所
function areaChange(){
	var area = $("#areaCode").find("option:selected").text();
	$("#area").val(area);
}

//场所
function placeChange(){
	var place = $("#placeCode").find("option:selected").text();
	$("#place").val(place);
}
</script>